package com.project.myBeans;

import org.springframework.stereotype.Component;

/**
 * 此类封装返回给app端或web端的数据和状态信息
 * 说明：
 * 增、删、改操作，一般会用到属性：success,msg；
 * 查询操作：用到success,data,total。
 */

@Component
public class ResponseBean {

    private boolean success;  //状态码/错误码; 0-成功；非0-失败
    private String msg = "";    //操作提示信息
    private Object data = null;          //单条数据 或 多条数据 皆可
    private long total = 0;          //data中返回记录总数

    public ResponseBean() {
        super();
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
